package com.rpc.test;


import com.rpc.serializer.CommonSerializer;
import com.rpc.serializer.HessianSerializer;
import com.rpc.serializer.ProtobufSerializer;
import com.rpc.test.entity.HelloObject;
import com.rpc.test.service.HelloService;
import com.rpc.transport.RpcClientProxy;
import com.rpc.transport.netty.client.NettyClient;

/**
 * @Author: Xiaohei
 * @CreateTime: 2021/11/13 12:50
 */
public class NettyTestClient {

    public static void main(String[] args) {
        NettyClient client = new NettyClient();
        client.setSerializer(new ProtobufSerializer());
        RpcClientProxy proxy = new RpcClientProxy(client);
        HelloService helloService = proxy.getProxy(HelloService.class);
        String res = helloService.hello(new HelloObject(1, "11"));
        System.out.println(res);
    }
}
